package com.xci.core.web;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * Tree节点
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TreeNode {
    /**
     * 节点Id
     */
    private String id;

    /**
     * 父节点Id
     */
    private String pid;

    /**
     * 节点文本
     */
    private String text;

    /**
     * 节点简拼
     */
    private String spell;

    /**
     * 节点css类
     */
    private String iconCls;

    /**
     * 该节点是否被选中
     */
    private Boolean checked;

    /**
     * 节点状态: open|closed
     */
    private String state;

    /**
     * 是否叶子节点
     */
    private int leaf;

    /**
     * 链接地址
     */
    private String url;

    /**
     * 子节点
     */
    private List<TreeNode> children;

    /**
     * 绑定该节点的自定义属性
     */
    private Map<String, String> attributes;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getSpell() {
        return spell;
    }

    public void setSpell(String spell) {
        this.spell = spell;
    }

    public String getIconCls() {
        return iconCls;
    }

    public void setIconCls(String iconCls) {
        this.iconCls = iconCls;
    }

    public Boolean getChecked() {
        return checked;
    }

    public void setChecked(Boolean checked) {
        this.checked = checked;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public int getLeaf() {
        return leaf;
    }

    public void setLeaf(int leaf) {
        this.leaf = leaf;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public List<TreeNode> getChildren() {
        return children;
    }

    public void setChildren(List<TreeNode> children) {
        this.children = children;
    }

    public Map<String, String> getAttributes() {
        return attributes;
    }

    public void setAttributes(Map<String, String> attributes) {
        this.attributes = attributes;
    }
}
